package com.xie.headline.sso.common;

import lombok.Data;

@Data
public class JsonResult {
    private boolean flag;
    private Integer code;
    private String errorMessage;
    private Object data;

    public JsonResult(boolean flag,Integer code, String errorMessage, Object data) {
        this.flag = flag;
        this.code = code;
        this.errorMessage = errorMessage;
        this.data = data;
    }

    public static JsonResult success(Object data){
        return new JsonResult(true,200,"操作成功",data);
    }
    public static JsonResult error(String msg){
        return new JsonResult(false,-1,msg,null);
    }
}
